Start

NCTWavPlayer ActiveX Control

Version 1.06

Properties Methods Events

The NCTWavPlayer control is visual editor of audiofiles, allowed the user to make many operations with waveform audio data.

With NCTWavPlayer control you can:

  • Open and display in special window WAV files in any format, maintaining by ACM drivers, installing in your Windows system. Since version 1.06 you can also open MP3 files.
  • Play audiofile or any part of it.
  • Record WAV file from microphone.
  • Edit WAV file visually (Cut, Copy, Paste, PasteFromFile, Mix, MixFromFile, Amplify, Invert, Reverse, Normalize, Stretch, Echo).
  • Convert audiofiles using ACM drivers.
  • Change waveform of audiofile using GetDataString, PutDataString methods or Value property.
You can insert NCTWavPlayer control in your application, maintaining ActiveX controls, as Visual Basic, Visual C++, Delphi, PowerBuilder, Visual FoxPro and others.


Properties

Property of audiofile

FormatString | nSamples
nChannels | nSamplesPerSec
nAvgBytesPerSec | nBlockAlign
wFormatTag | wBitsPerSample

Position of audiofile

StartPos | EndPos
StartShowPos | EndShowPos
PlayPos

Settings of sound

Volume | VolumeBalance
Gain | AutoGainControl

Appearance of window

VisibleBottomScale | VisibleRightScale
BottomScaleType | RightScaleType
VisibleGridX | VisibleGridY
StereoChannel

Colors

clrAnalogWavForm | clrBackground
clrCenterLine | clrCursor
clrDigitalWavform | clrGrid
clrPlayCursor | clrSelectedAnalogWav
clrSelectedBackground | clrSelectedCenterLine
clrSelectedDigitalWav

Setting of devices

devInput | devOutput
devInputMax | devOutputMax
devInputName | devOutputName

Editing

UndoEnable | RedoEnable
flgEndRecordBlock | flgSelectedPlay
Value | Selected

Misc

ClearClipboardBeforeExit | UndoRedoCount
TempDirectory | TotalAvailableFreeSpace
hWnd


AutoGainControl Property

Sets or returns flag indicating how control gain is executed for record: automatic or manual.

Syntax

object.AutoGainControl

The settings for return value are:
Setting Description

True Automatic gain control.
False Manual gain control.

Remarks

AutoGainControl property has type Boolean. This property accepts correct meaning only after applying Open or New methods. On default it sets to False.


BottomScaleType Property

Sets or returns type of bottom scale.

Syntax

object.BottomScaleType

The settings for return value are:
Setting Description

1 Sets points of bottom scale in samples.
2 Sets points of bottom scale in millisecond.

Remarks

BottomScaleType property has type Long.


Colors

Color properties

Sets or returns RGB colors for different objects in NCTWavPlayer using standard Windows palette.
clrAnalogWavForm | Sets or returns color of audiosignal between points.
clrBackground | Sets or returns color of background.
clrCenterLine | Sets or returns color of centerline.
clrCursor | Sets or returns color of cursor.
clrDigitalWavform | Sets or returns color of audiosignal in points..
clrGrid | Sets or returns color of grid.
clrPlayCursor | Sets or returns color of play cursor.
clrSelectedAnalogWav | Sets or returns color of select audiosignal between points.
clrSelectedBackground | Sets or returns color of selection background.
clrSelectedCenterLine | Sets or returns color of centerline of selection.
clrSelectedDigitalWav | Sets or returns color of selected audiosignal in points.


ClearClipboardBeforeExit

ClearClipboardBeforeExit Property

Sets or returns flag indicating to clear clipboard before exit or not.

Syntax

object.ClearClipboardBeforeExit

The settings for return value are:
Setting Description

True Clear clipboard before exit.
False Don't clear clipboard.

Remarks

ClearClipboardBeforeExit property has type Boolean. If this property sets to False, you can paste from clipboard in another session. On default it sets to False.


devInput Property

Sets or returns number of current record device.

Syntax

object.devInput

Remarks

devInput property has type Int.


devInputMax Property

Returns maximal number of record devices in your system.

Syntax

object.devInputMax

Remarks

devInputMax property has type Int.


devInputName Property

Returns name of current record device.

Syntax

object.devInputName

Remarks

devInputName property has type String.


devOutput Property

Sets or returns number of current playback device.

Syntax

object.devOutput

Remarks

devOutput property has type Int.


devOutputMax Property

Returns maximal number of playback devices in your system.

Syntax

object.devOutputMax

Remarks

devOutputMax property has type Int.


devOutputName Property

Returns name of current playback device.

Syntax

object.devOutputName

Remarks

devOutputName property has type String.


 EndPos Property

Sets or returns last playback position of part of WAV file. After loading of WAV file this position sets at last file's position.

Syntax

object.EndPos

Remarks

EndPos property has type Long. At this position playback stops. This property accepts correct meaning only after applying Open or New methods and can't exceed value of nSamples property.


Gain Property

Sets or returns a magnitude of volume for record of WAV file (uniform channels) .

Syntax

object.Gain

Remarks

Gain property has type Long and can accept value from 0 to 65535. This property accepts correct meaning only after applying Open or New methods.


Volume Property

Sets or returns a magnitude of volume for plaback of WAV file.

Syntax

object.Volume

Remarks

Volume property has type long and can accept value from 0 to 65535. This property accepts correct meaning only after applying Open or New methods.

See also

VolumeBalance


VolumeBalance Property

Sets or returns the relative volume between left and right channels in a stereo audio system for playback of WAV file.

Syntax

object.VolumeBalance

Remarks

VolumeBalance property has type Long and can accept value from 0 to 100. When VolumeBalance = 50, equal distribution is given to left and right speaker. If VolumeBalance < 50 the volume on the right channel is lower than that on the left channel, and vice versa.This property accepts correct meaning only after applying Open or New methods.

See also

Volume


StartPos Property

Sets or returns a first playback position of part of WAV file. After loading of WAV file this position sets at first file's position.

Syntax

object.StartPos

Remarks

StartPos property has type Long. Playback begins with that position. This property accepts correct meaning only after applying Open or New methods and can't exceed value of EndPos property.


StartShowPos Property

Sets or returns a first position of viewing part of WAV file. After loading of WAV file this position sets at first file's position and can be changed by ZoomIn or ZoomOut methods.

Syntax

object.StartShowPos

Remarks

StartShowPos property has type Long. This property accepts correct meaning only after applying Open or New methods and can has value less or equal than StartPos.


 PlayPos Property

Returns a current playback position in WAV file. This property is changed currently after applying of Play method.

Syntax

object.PlayPos

Remarks

PlayPos property has type Long. This property is read-only. This property accepts correct meaning only after applying Play method.


 EndShowPos Property

Sets or returns a last position of viewing part of WAV file. After loading of WAV file this position sets as last file's position and can be changed by ZoomIn or ZoomOut methods.

Syntax

object.EndShowPos

Remarks

EndShowPos property has type Long. This property accepts correct meaning only after applying Open or New method and can't exceed value of EndPos property.


FormatString

FormatString Property

Returns string with information about format of WAV file.

Syntax

object.FormatString

Remarks

FormatString property has type String. This property accepts correct meaning only after applying Open or New method.


flgEndRecordBlock Property

Sets or returns a flag indicating EndRecordBlock event is generating or not.

Syntax

object.flgEndRecordBlock

The settings for return value are:
Setting Description

True EndRecordBlock event is generating.
False EndRecordBlock event isn't generating.

Remarks

flgEndRecordBlock property has type Boolean. On default it sets to False.


flgSelectedPlay Property

Sets or returns a flag indicating selection while playing.

Syntax

object.flgSelectedPlay

The settings for return value are:
Setting Description

True Selection is performing while playing.
False Selection isn't performing while playing.

Remarks

flgSelectedPlay property has type Boolean. On default it sets to False.


hWnd Property

Returns a handle on NCTWavPlayer Window.

Syntax

object.hWnd

Remarks

Property hWnd has type OLE_HANDLE. This property accepts correct meaning only after applying Open or New methods.


 nAvgBytesPerSec Property

Returns a required average data-transfer rate, in bytes per second, for the format tag. If wFormatTag is WAVE_FORMAT_PCM, nAvgBytesPerSec should be equal to the product of nSamplesPerSec and nBlockAlign. For non-PCM formats, this value must be computed according to the manufacturer's specification of the format tag.

Syntax

object.nAvgBytesPerSec

Remarks

nAvgBytesPerSec property has type Long. This property is read-only. This property accepts correct meaning only after applying Open or New methods.


 nBlockAlign Property

Returns a block alignment, in bytes. The block alignment is the minimum atomic unit of data for the wFormatTag format type. If wFormatTag is WAVE_FORMAT_PCM, nBlockAlign should be equal to the product of nChannels and wBitsPerSample divided by 8 (bits per byte). For non-PCM formats, this value must be computed according to the manufacturer's specification of the format tag.

Syntax

object.nBlockAlign

Remarks

nBlockAlign property has type Long. This property is read-only. This property accepts correct meaning only after applying Open or New methods.


 nChannels Property

Returns a number of channels in the WAV file. Monaural data uses one channel and stereo data uses two channels.

Syntax

object.nChannels

Settings

The settings for return value are:
Setting Description

1 WAV file has type mono.
2 WAV file has type stereo.

Remarks

nChannels property has type Long. This property is read-only. This property accept correct meaning only after applying Open or New methods.


 nSamples Property

Returns a number of samples in WAV file.

Syntax

object.nSamples

Remarks

nSamples property has type Long. This property is read-only. This property accepts correct meaning only after applying Open or New methods.


 nSamplesPerSec Property

Returns a sample rate, in samples per second (hertz), that each channel should be played or recorded. If wFormatTag is WAVE_FORMAT_PCM, then common values for nSamplesPerSec are 8.0 kHz, 11.025 kHz, 22.05 kHz, and 44.1 kHz. For non-PCM formats, this value must be computed according to the manufacturer's specification of the format tag.

Syntax

object.nSamplesPerSec

Remarks

startPos property has type Long. This property is read-only. This property accepts correct meaning only after applying Open or New methods.


RedoEnable

 RedoEnable Property

Sets or returns flag indicating whether Redo Method is enabled or not.

Syntax

object.RedoEnable

Settings

The settings for return value are:
Setting Description

True Redo Method is enabled.
False Redo Method is not enabled.

Remarks

RedoEnable property returns has type Boolean. This property accepts correct meaning only after applying Open or New methods.


RightScaleType Property

Sets or returns type of right scale.

Syntax

object.RightScaleType

The settings for return value are:
Setting Description

1 Sets points of right scale in absolute units.
2 Sets points of right ruler in logariphmic (normalize).

Remarks

RightScaleType property has type Long. This property accepts correct meaning only after applying Open or New methods.


 Selected Property

Sets or returns flag indicating whether the part of WAV file is selected or not.

Syntax

object.Selected

Settings

The settings for return value are:
Setting Description

True Part of WAV file is selected.
False Part of WAV file is not selected.

Remarks

Selected property has type Boolean. This property accepts correct meaning only after applying Open or New methods.


 StereoChannel Property

Sets or returns a active channel (displaying in window) in the WAV file.

Syntax

object.StereoChannel

Settings

The settings for return value are:
Setting Description

0 Left channel.
1 Right channel.

Remarks

StereoChannel property has type Long. This property accepts correct meaning only after applying Open or New methods and valid only for stereo files.


TempDirectory Property

Sets or returns location for keeping of temporary files.

Syntax

object.TempDirectory

Remarks

TempDirectory property has type String. On default it sets to c:\windows\temp.


 TotalAvailableFreeSpace Property

Returns available free space on device, where temporary files are keeping.

Syntax

object.TotalAvailableFreeSpace

Remarks

TotalAvilableFreeSpace property has type Long. This property is read-only.


 UndoEnable Property

Sets or returns flag indicating whether Undo Method is enabled or not.

Syntax

object.UndoEnable

The settings for return value are:
Setting Description

True Undo Method is enabled.
False Undo Method is not enabled.

Remarks

UndoEnable property has type Boolean. This property accepts correct meaning only after applying Open or New methods.


 UndoRedoCount Property

Sets or returns maximal number of possible Undo or Redo operations.

Syntax

object.UndoRedoCount

Remarks

UndoRedoCount property has type Long. On default it sets to 4.


Value propierty

Value Property

Sets or returns magnitude in current position of WAV file. This position is returned by StartPos property.

Syntax

object.Value

Remarks

Value property has type Long. This property accepts correct meaning only after applying Open or New methods.


VisibleBottomScale Property

Sets or returns a flag of visibility bottom scale.

Syntax

object.VisibleBottomScale

The settings for return value are:
Setting Description

True Bottom scale is visible.
False Bottom scale is not visible.

Remarks

VisibleBottomScale property has type Boolean.


VisibleRuleRight property

VisibleRightScale Property

Sets or returns a flag of visibility right scale.

Syntax

object.VisibleRightScale

The settings for return value are:
Setting Description

True Right scale is visible.
False Right scale is not visible.

Remarks

VisibleRightScale property has type Boolean.


VisibleGridX Property

Sets or returns a flag of visibility grid on axis X.

Syntax

object.VisibleGridX

The settings for return value are:
Setting Description

True Grid on axis X is visible.
False Grid on axis X is not visible.

Remarks

VisibleGridX property has type Boolean.


VisibleGridY Property

Sets or returns a flag of visibility grid on axis Y.

Syntax

object.VisibleGridY

The settings for return value are:
Setting Description

True Grid on axis Y is visible.
False Grid on axis Y is not visible.

Remarks

VisibleGridY property has type Boolean.


 wBitsPerSample Property

Returns a number of bits per sample for the wFormatTag format type. If wFormatTag is WAVE_FORMAT_PCM, then wBitsPerSample should be equal to 8 or 16. For non-PCM formats, this member must be set according to the manufacturer's specification of the format tag. Note that some compression schemes cannot define a value for wBitsPerSample, so this value can be zero.

Syntax

object.wBitsPerSample

Remarks

wBitsPerSample property has type Long. This property is read-only. This property accepts correct meaning only after applying Open or New methods.


 wFormatTag Property

Returns a waveform-audio format type of file. Format tags are registered with Microsoft Corporation for many compression algorithms.

Syntax

object.wFormatTag

Remarks

wFormatTag property has type Long. This property is read-only. This property accepts correct meaning only after applying Open or New methods.


Methods

Operations with audiofiles

Open | Save
Close | Record
Play | Stop
PausePlay | ContinuePlay
ConvertLikeSample | ConvertFromMenu
New | SaveSelect

Editing of audiofile

Cut | Copy
Paste | Mix
CopyToClipboard | PasteFromClipboard
MixFromFile | PasteFromFile
Undo | Redo

Effects

Amplify | Silence
Fade | Echo
Invert | Stretch
Reverse | Normalize
InsertSilence

Displaying of audiofile

ZoomIn | ZoomOut
Zoom | Full
Repaint

Misc

GetDataString PutDataString
SamplToSec


 Amplify Method

Increases or decreases volume on Amplification % of selected part of WAV file.

Syntax

object.Amplify(Amplification)

The Amplify method syntax has these parts:
Part Description

Amplification Integer. Specifies % of increasing of volume.

If Amplify method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 Close Method

Closes WAV file, opened before by Open Method.

Syntax

object.Close( )

If Close method is successful, it returns 0, otherwise it returns error code.


 ContinuePlay Method

Continues playback of WAV file after applying PausePlay method.

Syntax

object.ContinuePlay( )

If ContinuePlay method is successful, it returns 0, otherwise it returns error code.


 ConvertFromMenu Method

Converts WAV file to the other format. This method calls standard Windows menu in which you can pick parameters of WAV file. After converting it is necessary to save WAV file, using Save method.
Syntax

object.ConvertFromMenu( )

If ConvertFromMenu method is successful, it returns 0, otherwise it returns error code.


ConvertLikeSample method

 ConvertFromSample Method

Converts WAV file to the format of chosen example file. After converting it is necessary to save WAV file, using Save method.

Syntax

object.ConvertFromSample(fileName)

The ConvertFromSample method syntax has these parts:
Part Description

fileName String. Specifies pathname of example WAV file.

If ConvertFromSample method is successful, it returns 0, otherwise it returns error code.


 Copy Method

Copies selected part of file in buffer. This object will be available only in current control and can be inserted in WAV file using Paste method.

Syntax

object.Copy( )

If Copy method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 CopyToClipboard Method

Copies selected part of file to Windows Clipboard.

Syntax

object.CopyToClipboard( )

If CopyToClipboard method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 Cut Method

Cuts selected part of file and puts it in buffer. This object will be available only in current control and can be inserted in WAV file using Paste method.

Syntax

object.Cut( )

If Cut method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 Echo Method

Inserts echo in selected part of WAV file.

Syntax

object.Echo(Delay, Magnitude)

The Echo method syntax has these parts:
Part Description

Delay Long. Specifies time of delay in milliseconds.
Magnitude Integer. Specifies % of increasing of volume in echo.

If Echo method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 Fade Method

Creates a fading in (soft to loud) or fading out (loud to soft) effect in selected part of WAV file. The wave data will be linearly faded from starting magnitude AmplifyStart to ending magnitude AmplifyEnd.

Syntax

object.Fade(AmplifyStart,AmplifyEnd)

The Fade method syntax has these parts:
Part Description

AmplifyStart | Integer. Specifies % of starting magnitude.
AmplifyEnd | Integer. Specifies % of ending magnitude.

If Fade method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only after Selected property.


 Full Method

Restores displaying of WAV file to original size.

Syntax

object.Full( )

If Full method is successful, it returns 0, otherwise it returns error code.


 GetDataString Method

Returns selected part of file as string in hexadecimal format.

Syntax

object.GetDataString( )

If GetDataString method is successful, it returns string (length isn't 0), otherwise it returns zero string.

Remarks

This method can be applied only if Selected property sets in True.


 InsertSilence Method

Insetrs zero part in WAV file with ms longitude at position StartPos.

Syntax

object.InsertSilence(ms as long)

If InsertSilence method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 Invert Method

Inverts selected part of WAV file.

Syntax

object.Invert( )

If Invert method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 Mix Method

Mixes selected part of WAV file with object in buffer.

Syntax

object.Mix(AmpSelect, AmpPast)

The Mix method syntax has these parts:
Part Description

AmpSelect Integer. Specifies % of increasing of volume in selected part of WAV file.
AmpPast Integer. Specifies % of increasing of volume in buffer.

If Mix method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only Copy method and if Selected property sets in True.


 MixFromFile Method

Mix selected part of WAV file with other file.

Syntax

object.MixFromFile(FileName,AmpSelect, AmpPast)

The MixFromFile method syntax has these parts:
Part Description

fileName String. Specifies pathname of inserting WAV file.
AmpSelect Integer. Specifies % of increasing of volume in selected part of WAV file.
AmpPast Integer. Specifies % of increasing of volume in inserting WAV file.

If MixFromFile method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True. If longitude of inserting WAV file exceeds of selected part, then only part of file, which equal to selected one, is mixed.


 New Method

Creates WAV file.

Syntax

object.New (SamplesPerSec As Long, nChannels As Long)

The New method syntax has these parts:
Part Description

SamplesPerSec Long. Specifies sample rate of new WAV file.
nChannels Long. Specifies number of channels in the new WAV file.

If New method is successful, it returns 0, otherwise it returns error code.

Remarks

After applying New method all properties accept correct meanings.


 Normalize Method

Normalizes selected part of WAV file.

Syntax

object.Normalize()

If Normalize method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only after Selected property.


 Open Method

Opens WAV or MP3 file.

Syntax

object.Open(fileName)

The Open method syntax has these parts:
Part Description

fileName String. Specifies pathname of audiofile.

If Open method is successful, it returns 0, otherwise it returns error code.

Remarks

After applying Open method all properties accept correct meanings. This method can open MP3 files using ACM driver. You must have installed Fraunhofer IIS MPEG Layer-3 Codec in your system. You can open MP3 files with next parameters:

Frequency (kHz) | Bitrate (kbps) | Channels
48000 | 48,56,64,80,96,112,128,160,192,224,256,320 | stereo
48000 | 24,32,48, 56,64 | mono
44100 | 48, 56, 64,80, 96, 112, 128,160,192,224,256,320 | stereo
44100 | 24,32,48, 56,64 | mono
32000 | 48, 56, 64,80, 96, 112, 128,160,192,224,256,320 | stereo
32000 | 24,32,48, 56,64 | mono
24000 | 24,32,48, 56,64 | stereo
24000 | 24,32,48, 56,64 | mono
22050 | 24,32,48, 56,64 | stereo
22050 | 24,32,48, 56,64 | mono
16000 | 24,32,48, 56,64 | stereo
16000 | 24,32,48, 56,64 | mono
12000 | 24,32,48, 56,64 | stereo
12000 | 24,32,48, 56,64 | mono
11025 | 24,32,48, 56,64 | stereo
11025 | 24,32,48, 56,64 | mono
8000 | 24,32,48, 56,64 | stereo
8000 | 24,32,48, 56,64 | mono


 Paste Method

Inserts part of file from buffer.

Syntax

object.Paste( )

If Paste method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only after Copy or Cut Methods.


Paste method

 PasteFromClipboard Method

Inserts part of file from Windows Clipboard.

Syntax

object.PasteFromClipboard( )

If PasteFromClipboard method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only after CopyToClipboard method.


 PasteFromFile Method

Inserts file to current position of opened WAV file.

Syntax

object.Paste(fileName)

The PasteFromFile method syntax has these parts:
Part Description

fileName String. Specifies pathname of inserted WAV file.

If PasteFromFile method is successful, it returns 0, otherwise it returns error code.


 PausePlay Method

Makes pause in playback. This method can be applied only after Play method.

Syntax

object.PausePlay( )

If PausePlay method is successful, it returns 0, otherwise it returns error code.


 Play Method

Begins playback of part of WAV file.

Syntax

object.Play( )

If Play method is successful, it returns 0, otherwise it returns error code.

Remarks

Playback begins with position, returned by StartPos and ended at EndPos position. Volume is determined by Volume and VolumeBalance properties.


 PutDataString Method

Inserts data in file from string in hexadecimal format.

Syntax

object.PutDataString(Str )

The PutDataString method syntax has these parts:
Part Description

Str String. Specifies data in hexadecimal format.

If PutDataString method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only after GetDataString Methods.


 Record Method

Begins record from microphone to the end of opened WAV file.

Syntax

object.Record( )

If Record method is successful, it returns 0, otherwise it returns error code.

Remarks

Record gain is determined by Gain properties.


 Redo Method

Redoes last action.

Syntax

object.Redo( )

If Redo method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if RedoEnable property returns True.


 Repaint Method

Repaints window in which WAV file is displayed.

Syntax

object.Repaint( )

If Repaint method is successful, it returns 0, otherwise it returns error code.


 Reverse Method

Reverses selected part of WAV file.

Syntax

object.Reverse()

If Reverse method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 SamplToSec Method

Transfers number of samples to seconds.

Syntax

object.SamplToSec(Pos)

The SamplToSec method syntax has these parts:
Part Description

Pos Long. Specifies the number of samples in WAV file.

If SamplToSec method is successful, it returns 0, otherwise it returns error code.


 Save Method

Saves modified WAV or MP3 files, opened before by Open method or created by New method.

Syntax

object.Save(fileName)

The Save method syntax has these parts:
Part Description

fileName String. Specifies pathname of audiofile.

If Save method is successful, it returns 0, otherwise it returns error code.

Remarks

If you want to save WAV file as MP3, you must before convert it to MPEG Layer 3 using ConverLikeSample or ConvertFromMenu methods.


 SaveSelect Method

Saves select part of modified WAV file, opened before by Open Method.

Syntax

object.SaveSelect(fileName)

The Save method syntax has these parts:
Part Description

fileName String. Specifies pathname of WAV file.

If SaveSelect method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 Silence Method

Decreases volume of sound to zero in selected part of WAV file.

Syntax

object.Silence( )

If Silence method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 Stop Method

Stops playback or record of WAV file.

Syntax

object.Stop( )

If Stop method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only after Play or Record method. After applying this method startPos property sets in original position of WAV file.


 Stretch Method

Stretches selected part of WAV file.

Syntax

object.Stretch(Percent)

The Stretch method syntax has these parts:
Part Description

Percent Integer. Specifies % of stretch in selected part of WAV file.

If Stretch method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only after Selected property.


 Undo Method

Undoes last action.

Syntax

object.Undo( )

If Undo method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if UndoEnable property returns True.


 ZoomIn Method

Zooms of selected part of WAV file in viewing window.

Syntax

object.ZoomIn( )

If ZoomIn method is successful, it returns 0, otherwise it returns error code.

Remarks

This method can be applied only if Selected property sets in True.


 ZoomOut Method

Can be applied after ZoomIn method.

Syntax

object.ZoomOut( )

If ZoomOut method is successful, it returns 0, otherwise it returns error code.


 Zoom Method

Zooms of part of WAV file in viewing window without selection.

Syntax

object.Zoom (StartPos, EndPos)

The Zoom method syntax has these parts:
Part Description

StartPos Long. Specifies first position for zooming.
EndPos Long. Specifies last position for zooming.

If Zoom method is successful, it returns 0, otherwise it returns error code.


Events

NCTWavPlayer Events

VolumeChange | GainChange
MouseMove | MouseDown
MouseUp | KeyUp
KeyPress | KeyDown
ChangePos | ChangePlayPos
EndRecordBlock | LevelPlay
OperationBlock | EndPlay


 ChangePos Event

Occurs when current file's position is changed after applying property or methods.

Syntax

Private Sub object_ChangePos( )


ChagePlayPos event

 ChangePlayPos Event

Occurs when position is changed while playback after applying Play method.

Syntax

Private Sub object_ChangePlayPos( )


 EndPlay Event

Occurs when playback is finished.

Syntax

Private Sub object_EndPlay( )


 EndRecordBlock Event

Occurs when record block is finished.

Syntax

Private Sub object_EndRecordBlock (StringRecord As String)

The Open method syntax has these parts:
Part Description

StringRecord String. Specifies string in hexadecimal format from record buffer.

If EndRecordBlock method is successful, it returns 0, otherwise it returns error code.

Remarks

You can use this event for reading record buffer while recording. For converting StringRecord to PCM format you can use next source code on C.


 GainChange Event

Occurs when gain is changed while record after applying Record method.

Syntax

Private Sub object_GainChange( )


 KeyDown Event

Occurs whan key button is pressed. This is standard ActiveX event.

Syntax

Private Sub object_KeyDown(KeyCode, SHIFT )

The KeyDown event syntax has these parts:
Part Description

KeyCode Integer. Specifies code of pressed key.
SHIFT Integer. Specifies pressed or not SHIFT key.


 KeyPress Event

Occurs whan key is pressing. This is standard ActiveX event.

Syntax

Private Sub object_KeyPress(ASCII)

The KeyPress event syntax has these parts:
Part Description

ASCII Integer. Specifies ASCII code of pressed key.


 KeyUp Event

Occurs when key button is unpressed. This is standard ActiveX event.

Syntax

Private Sub object_KeyUp(KeyCode, SHIFT )

The KeyUp event syntax has these parts:
Part Description

KeyCode Integer. Specifies code of unpressed key.
SHIFT Integer. Specifies pressed or not SHIFT key.


 LevelPlay Event

Occurs when current playing level is changed.

Syntax

Private Sub object_LevelPlay(Level)

The LevelPlay event syntax has these parts:
Part Description

Level Long. Specifies level of playback.


 MouseDown Event

Occurs whan mouse button is pressed. This is standard ActiveX event.

Syntax

Private Sub object_MouseDown( )


 MouseMove Event

Occurs whan mouse is moving. This is standard ActiveX event.

Syntax

Private Sub object_MouseMove( )


 MouseUp Event

Occurs when mouse button is unpressed. This is standard ActiveX event.

Syntax

Private Sub object_MouseUp( )


 OperationBlock Event

Occurs when some operation with WAV file is executed after applying next methods:Open, Save, SaveSelect, Cut, Copy, Paste, Mix, PasteFromFile, MixFromFile, Normalize, Amplify, Echo, Invert, Reverse, Fade, Stretch, Repaint, GetDataString, PutDataString.

Syntax

Private Sub object_OperationBlock (Percent)

The OperationBlock event syntax has these parts:
Part Description

Percent Integer. Specifies % of execution.

Remarks

At the end of operation Percent=100.


 VolumeChange Event

Occurs when volume is changed while playback after applying Play method.

Syntax

Private Sub object_VolumeChange( )


NCTWavPlayer FAQ

NCTWavPlayer 1.06

FAQ: Frequently Asked Questions

  1. What is NCTWavPlayer?
  2. With what type of files NCTWavPlayer can work?
  3. I can use NCTWavPlayer only in VB 6.0?
  4. It is possible to use NCTWavPlayer in VB 5.0?
  5. How can I have access to an opened wave file and read the sampled data for further processing?
  6. How can I change the format of WAV file: change sampling rate, convert stereo to mono or 16 bit file to 8 bit (and vice versa)?
  7. How can I record using 8 bit instead 16?
  8. I downloaded and run the installation. However, I cannot seem to get the OCX to register nor loaded in the VB sample. When running regsvr32 on the file, the error message is displayed.
  9. What restriction are existing for demo version of NCTWavPlayer?
  10. Is it possible to display wave form for the left and right output at the same time?
  11. How can I pay for registration of NCTWavPlayer?
  12. I have some very powerful oscilloscopes, spectrum analyzers, etc. that I feed real-time audio information to. Is there any method in the NCTWavPlayer to have it pass real-time PCM buffers as it is playing through or recording a file? That would be very helpful in combining it with other controls.
  13. I try to open MP3 file, but without success. What is matter?
  1. What is NCTWavPlayer?

    NCTWavPlayer ActiveX Control is a visual editor of audiofiles. Inserting it in your application you can make many operations with waveform audio data.
  2. With what type of files NCTWavPlayer can work?

    3. NCTWavPlayer can open, play and edit any WAV files (including compressed), for which installed ACM driver. Since version 1.06 you can also work with MP3 files.
  3. I can use NCTWavPlayer only in VB 6.0?

    4. You can insert NCTWavPlayer in any application, which maintains ActiveX. We have tested it for VB 6.0, VC 6.0, FoxPro 6.0. With NCTWavPlayer you get sample on VB 6.0 and VC++ 6.0.
  4. It is possible to use NCTWavPlayer in VB 5.0?

    5. Our sample was written on VB 6.0 and it doesn't load in VB 5.0. But if you create new project on VB 5.0, you can able to insert my NCTWavPlayer in it as well as in VB 6.0 and VC++.
  5. How can I have access to an opened wave file and read the sampled data for further processing?

    6. It is possible to analyze and edit WAV file after loading using GetDataString, PutDataString Methods or Value Property. With this methods or property you can view and change magnitude of each position.
  6. How can I change the format of WAV file: change sampling rate, convert stereo to mono or 16 bit file to 8 bit (and vice versa)?

    7. You can change format of WAV file using ConvertLikeSample or ConvertFromMenu method.
  7. How can I record using 8 bit instead 16?

    8. You can record using 16 bit and then apply ConvertLikeSample or ConvertFromMenu method.
  8. I downloaded and run the installation. However, I cannot seem to get the OCX to register nor loaded in the VB sample. When running regsvr32 on the file, the error message is displayed.

    9. For working NCTWavPlayer you need to have next files in your system:
    MFC42.DLL
    MSVCRT.DLL
    OLE32.DLL
    OLEAUT32.DLL
    And MFC42.DLL and MSVCRT.DLL must have version not below than 6.
    If you have VB 6.0 or VC 6.0 this files must present on your computer. We don't include those files in installation program deliberately for purpose to reduce of file size that allows to cut down download time.
  9. What restriction are existing for demo version of NCTWavPlayer?

    10. There are restriction on longitude of WAV file in demo. It must be not more than 10 sec. Also PasteFromFile and MixFromFile methods don't available in demo.
  10. Is it possible to display wave form for the left and right output at the same time?

    11. In this version it is impossible. You can load two controls simultaneously for realization of this function. Maybe in future we'll realize that.
  11. How can I pay for registration of NCTWavPlayer?

    12. You can pay for NCTWavPlayer using www.shareit.com:
    http://shareit1.element5.com/programs.html?productid=105310&language=English
    After registration we will send you registration key, witch you must insert in your application.
  12. I have some very powerful oscilloscopes, spectrum analyzers, etc. that I feed real-time audio information to. Is there any method in the NCTWavPlayer to have it pass real-time PCM buffers as it is playing through or recording a file? That would be very helpful in combining it with other controls.

    13. Since with release 1.06 it is possible. For that you must set flgEndRecordBlock property in True, then when EndRecordBlock Event will be generated and the you can read StringRecod in hexadecimal format as parameter of this event. For converting StringRecord to PCM format you can use next source code on C.
  13. I try to open MP3 file, but without success. What is matter?

    If you want to open MP3 files in NCTWavPlayer you must have installed Fraunhofer IIS MPEG Layer-3 Codec in your system. NCTWavPlayer used ACM driver for opening of MP3.


About

NCTWavPlayer ActiveX Control

was developed by NCT company

Nizhny Novgorod, Russia

http://www.nctech.nino.ru

Phone: +7-8312-621-801

Leader programmer: | Lev Bannov
Programmer: | Ellen Subbotina
Technical writer: | Alexander Konioukhov


Errors

Error code

Value | Error code
0 | No error
-10 | Load file error
-11 | Play error
-12 | Record error
-13 | File format error
-14 | Output driver error
-15 | Input driver error
-16 | Draw error
-17 | Out of memory
-18 | ACM driver error
-19 | Mixer driver error


Sample code Visual C++

 for (i=0; i<strsize/4; i++)
{
t0 = strBuf[4*i+0] - 48;
t1 = strBuf[4*i+1] - 48;
t2 = strBuf[4*i+2] - 48;
t3 = strBuf[4*i+3] - 48;

if (t0>9) t0-=7;
if (t1>9) t1-=7;
if (t2>9) t2-=7;
if (t3>9) t3-=7;

WavBuf[i] = (t2*4096+t3*256+t0*16+t1);
if (WavBuf[i]>=32768) WavBuf[i]-=65536;
}